package com.sky.task;

import com.sky.websocket.WebSocketServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class WebSocketTask {

    @Autowired
    private WebSocketServer webSocketServer;
//    @Scheduled(cron = "0/5 * * * * ?")
    public void sendMsgToClient(){
        webSocketServer.sendToAllClient("欢迎来成都黑马培训Java");
    }
}
